package com.zzw.util;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by ZZW on 2016/4/18.
 */
public class DBUtil extends SQLiteOpenHelper{

    private static final String DBNAME = "interview.db";
    private static final int DBVERSION = 1;

    public DBUtil(Context context){
        super(context,DBNAME,null,DBVERSION);
    }

    public DBUtil(Context context,String name,SQLiteDatabase.CursorFactory factory,int version){
        super(context,name,factory,version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = "create table ques_ans("+
                " id integer primary key," +
                " question text," +
                " answer text)";
        db.execSQL(sql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }


}
